package com.toune.movie.mvp.adapter;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.toune.movie.R;
import com.toune.movie.mvp.activity.VipVideoUrlActivity;
import com.toune.movie.vo.VideoVo;

import java.util.List;

/**
 * Created by Administrator on 2018/5/17.
 */

public class VideoAdapter extends BaseQuickAdapter<VideoVo, BaseViewHolder> {


    public VideoAdapter(int layoutResId, @Nullable List<VideoVo> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, final VideoVo data) {
        ImageView iconIv = holder.getView(R.id.icon_iv);
        TextView nameTv = holder.getView(R.id.name_tv);

        Glide.with(mContext).load(data.getImage()).apply(new RequestOptions().placeholder(R.mipmap.holder).error(R.mipmap.holder)).into(iconIv);
        nameTv.setText(data.getName());
    }
}
